<template>
	<div class="header">
		<img src="@/assets/img/mobile/logo.png" class="logo" />
		<ul class="menus">
			<li>
				<router-link to="/mobile/home">首页推荐</router-link>
			</li>
			<li>
				<router-link to="/mobile/bookslist">书库</router-link>
			</li>
			<li>
				<router-link to="/mobile/mine">我的</router-link>
			</li>
		</ul>
		<div class="search" @click="goSearch()">
			<img src="@/assets/img/mobile/search.png" />
		</div>
	</div>
</template>

<script>
	export default {
		name: 'MobileHeader',
		data() {
			return {

			}
		},
		methods: {
			goSearch() {
				this.$router.push('/mobile/search')
			}
		}
	}
</script>

<style scoped>
	.header {
		width: 100%;
		height: 3.5rem;
		background-color: #282b33;
		display: flex;
		align-items: center;
		justify-content: space-between;
		/* position: relative; */
		position: fixed;
		top: 0;
		z-index: 10;
	}

	.header .logo {
		margin: 0.5rem;
	}

	.header .menus {
		margin: 0;
		padding: 0;
		list-style: none;
		width: 55%;
		height: 100%;
		color: white;
		display: block;
		
	}

	.header .menus li a {
		white-space: nowrap;
		overflow: hidden;
		text-decoration: none;
		display: block;
		width: 33.33%;
		float: left;
		height: 3.2rem;
		line-height: 3.2rem;
		text-align: center;
		color: white;
	}

	.header .menus li .router-link-active {
		border-bottom: 0.3rem solid gold;
		color: gold;
	}

	.header .search {
		right: 0.5rem;
		width: 2rem;
		height: 2rem;
		border: 1px solid white;
		border-radius: 50%;
		margin-right: 0.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	/* hover 属于PC端的鼠标操作，不适合在移动端运行 */
	/* 	.header .search:hover{*/
	/* 动画的名字 动画的时长 动画的速度 */
	/* animation: formWidth 1s linear; */
	/* } */
	/* 将form宽度从2rem——>16rem */
	@keyframes formWidth {
		0% {
			width: 2rem;
		}

		100% {
			width: 16rem;
		}
	}
</style>
